home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-08-31 | 833 b | 52 lines | [TEXT/PJMM] |
- program PICTWindow;
- const
- kBaseResID = 128;
-
- {————————————————> WindowInit <—-}
- procedure WindowInit;
- var
- window: WindowPtr;
- begin
- window := GetNewWindow(kBaseResID, nil, WindowPtr(-1));
-
- if window = nil then
- begin
- SysBeep(10);
- ExitToShell;
- end;
-
- ShowWindow(window);
- SetPort(window);
- end;
-
- {————————————————> DrawMyPicture <—-}
- procedure DrawMyPicture;
- var
- pictureRect: Rect;
- picture: PicHandle;
- begin
- picture := GetPicture(kBaseResID);
-
- if picture = nil then
- begin
- SysBeep(10);
- ExitToShell;
- end;
-
- pictureRect := picture^^.picFrame;
-
- OffsetRect(pictureRect, -pictureRect.left, -pictureRect.top);
-
- DrawPicture(picture, pictureRect);
-
- FrameRect(pictureRect);
- end;
-
- {————————————————> PICTWindow <—-}
- begin
- WindowInit;
- DrawMyPicture;
-
- while not Button do
- ;
- end.